package orchestration.businessprocess.model.nodes;

import java.util.HashSet;
import java.util.Set;

import orchestration.businessprocess.model.BPNodeId;
import orchestration.businessprocess.model.IBPVisitor;


/**
 * A fork gateway has 1 predecessor and a set of successors.
 * All the successors must be visited
 * @author  <a href="mailto:car.ferrarini@gmail.com">Carlo Ferrarini</a>
 */
public class BPForkGateway extends BPNode {

	/**
	 * @uml.property  name="nexts"
	 */
	private Set<BPNode> nexts;
	BPForkGateway(BPNodeId id,Set<BPNode> next) {
		super(id,BPNode.NODE_TYPE_FGW,null,null);
		this.nexts= next;
	}
	
	public BPForkGateway(BPNodeId id) {
		super(id,BPNode.NODE_TYPE_FGW,null,null);
		this.nexts= new HashSet<BPNode>();
	}

	/**
	 * @return
	 * @uml.property  name="nexts"
	 */
	public Set<BPNode> getNexts(){
		return nexts;
	}
	@Override
	public void accept(IBPVisitor visitor) {
		visitor.visit(this);
	}
	public void addNext(BPNode trt){
		this.nexts.add(trt);
	}
}
